import {observable,autorun,action} from "mobx"

class commonStore {
    constructor(){
        this.SliderCollapsed = localStorage.getItem("sliderState") === "true";
        autorun(()=>{
            //存储到 本地
            if(this.SliderCollapsed !== null) localStorage.setItem("sliderState",this.SliderCollapsed)
        })
    }

    @observable SliderCollapsed = false;

    @observable LayoutTitleState = true;

    @observable LoadingBarState = true;

    @action
    setLayoutTitleState = (state= false)=>{
        this.LayoutTitleState = state;
    }
}

export default new commonStore()
